﻿CREATE function MIN3(@a int,@b int,@c int ) 
--Returns the smallest of 3 numbers.
returns int
as
BEGIN
declare @temp int
if (@a < @b)  AND (@a < @c)
	select @temp=@a
else 
	if (@b < @a)  AND (@b < @c)
		select @temp=@b
	else
		select @temp=@c
return @temp
END

